{* Smarty *}
{if $TBODY_TD}
<style type="text/css">@import "/templates/admin/js/dataTables/css/demo_table.css";</style>
<script type="text/javascript" src="/templates/admin/js/dataTables/js/jquery.dataTables.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		var NowWrapTable = $('.nowraptable').dataTable( {
			"sDom":'Rlfrtip',
			"bStateSave": true,
			"aaSorting" : [],
			"aoData": [
			{foreach $CFG_FIELD.aoData.bSortable as $key => $bool}
			  {if $bool eq "null"}null,
			  {else}{
				  "bSortable": {$bool}
			  },{/if}
			{/foreach}
			]
		});		
	});
</script>
<div id="dialog_alert"></div>
<div id="confirm">{$CONFIRM}</div>
<form action="" method="post" id="pages_form_change">
<input type="hidden" name="subaction" value="updateitems" />
<table cellpadding="0" cellspacing="0" border="0" class="nowraptable">
  <thead>
    <tr> 
    {if $CFG_FIELD.edit}<th>&nbsp;</th>{/if}
    {if $CFG_FIELD.show}<th><a rel="{$TABLE}" href="javascript:void(0);" title="Отображать/не отображать все записи" class="select_show ui-helper-clearfix ui-state-default ui-corner-all"><span class="ui-icon ui-icon-locked"></span></a></th>{/if}
	{if $CFG_FIELD.delete}<th><a rel="delinput_{$MODE}" href="javascript:void(0);" title="Удалить все записи" class="select_delete ui-helper-clearfix ui-state-default ui-corner-all"><span class="ui-icon ui-icon-closethick"></span></a></th>{/if}
    {if $CFG_FIELD.por}<th>Порядок</th>{/if}    
	{foreach $CFG_FIELD.field_cfg as $k => $v}<th width="{$v.width}" title="{$v.name}">{$v.name}</th>{/foreach}
    </tr>
  </thead>
  <tbody>
  {foreach $TBODY_TD as $tbody_item_key => $tbody_item_value}<tr>
    {if $CFG_FIELD.edit}<td><a href="?m=content&id={$smarty.get.id}&parent={$smarty.get.parent}&catalog_id={$tbody_item_value.id}&catalog_parent={$tbody_item_value.parent}&type=edit" title="Редактировать" class="ui-helper-clearfix ui-state-default ui-corner-all edit-item-pages"><span class="ui-icon ui-icon-pencil"></span></a></td>{/if}
    {if $CFG_FIELD.show}<td><input type="checkbox" class="mini-switch showhide" id="{$TABLE}::{$tbody_item_value.id}" value="1"{if $tbody_item_value.show} checked="checked"{/if} /></td>{/if}
    {if $CFG_FIELD.delete}<td><input type="checkbox" class="delinput_{$MODE} mini-switch-delete" name="del[]" value="{$tbody_item_value.id}" /></td>{/if}
    {if $CFG_FIELD.por}<td><input type="text" name="por[{$tbody_item_value.id}]" value="{$tbody_item_value.por}" size="3" class="por_input" /></td>{/if}    
    {foreach $CFG_FIELD.field_cfg as $k => $v}<td title="{if is_array($v.fieldname)}{foreach $v.fieldname as $k_sysname => $v_sysname}{$tbody_item_value[$v_sysname]} {/foreach}{else}{$tbody_item_value[{$v.fieldname}]|strip_tags}{/if}" {$v.attr}>{if $v.link}<a href="?m=content&id={$smarty.get.id}&parent={$smarty.get.parent}&catalog_id={$tbody_item_value.id}&catalog_parent={$tbody_item_value.parent}&type=edit">{/if}{if is_array($v.fieldname)}{foreach $v.fieldname as $k_sysname => $v_sysname}{$tbody_item_value[$v_sysname]} {/foreach}{else}{$tbody_item_value[{$v.fieldname}]|strip_tags}{/if}{if $v.link}</a>{/if}</td>{/foreach}
   </tr>{/foreach}
   </tbody>  
  </table>
  <div class="clear"></div>
  <a href="javascript:void(0);" class="ui_wo_buttons change_button ui-state-default ui-corner-all"><span class="ui-icon ui-icon-refresh"></span>Изменить</a>
</form>
{else}
<div id="info_table" class="ui-state-error ui-corner-all">
  <p><span class="ui-icon ui-icon-alert" style="float:left;margin-right:.3em;"></span>
  <strong>Внимание!</strong> В выбранном разделе <strong>записей нет</strong></p>
</div>
{/if}

{if $INFO_TABLE}<br />
<div id="info_table" class="ui-state-highlight ui-corner-all">
  <p><span class="ui-icon ui-icon-info" style="float:left;margin-right:0.3em;"></span>
  <strong>Дата создания таблицы:</strong> {$INFO_TABLE.create_time} <strong>Последнее обновление: </strong> {$INFO_TABLE.update_time}</p>
</div>{/if}